import NftEggsStore from "../contracts/NftEggsStore.cdc"

transaction(listingResourceID: UInt64, storefrontAddress: Address) {
    let storefront: &NftEggsStore.Storefront{NftEggsStore.StorefrontPublic}

    prepare(acct: AuthAccount) {
        self.storefront = getAccount(storefrontAddress)
            .getCapability<&NftEggsStore.Storefront{NftEggsStore.StorefrontPublic}>(
                NftEggsStore.StorefrontPublicPath
            )!
            .borrow()
            ?? panic("Could not borrow Storefront from provided address")
    }

    execute {
        // Be kind and recycle
        self.storefront.cleanup(listingResourceID: listingResourceID)
    }
}
